#include <string.h>
#include "global.h"

struct char_font {
	char ascii;
	char font[9][8];
};

struct char_font font_table[]= {
	{
		' ',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'!',
		{
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0}
		}
	},
	{
		'"',
		{
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'#',
		{
			{0,0,0,0,1,0,1,0},
			{0,0,0,0,1,0,1,0},
			{0,0,1,1,1,1,1,1},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,1,1,1,1,1,1,1},
			{0,0,1,0,1,0,0,0},
			{0,0,1,0,1,0,0,0}
		}
	},
	{
		'$',
		{
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,0,0},
			{0,0,0,1,1,1,0,0},
			{0,0,0,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0},
			{0,0,0,0,1,0,0,0}
		}
	},
	{
		'%',
		{
			{0,0,1,0,0,0,0,0},
			{0,1,0,1,0,0,0,1},
			{0,0,1,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,0,0,0,1,0},
			{0,1,0,0,0,1,0,1},
			{0,0,0,0,0,0,1,0}
		}
	},
	{
		'&',
		{
			{0,0,0,1,1,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,1,0,0,0,0},
			{0,1,0,0,1,0,0,1},
			{0,1,0,0,1,0,1,0},
			{0,1,0,0,0,1,0,0},
			{0,0,1,1,1,0,1,1}
		}
	},
	{
		'\'',
		{
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'(',
		{
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,1,0,0}
		}
	},
	{
		')',
		{
			{0,0,1,0,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,0,0,0,0,0}
		}
	},
	{
		'*',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,1,1,0,1,1,0},
			{0,0,0,1,1,1,0,0},
			{0,1,1,1,1,1,1,1},
			{0,0,0,1,1,1,0,0},
			{0,0,1,1,0,1,1,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'+',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,1,1,1,1,1,1,1},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		',',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0}
		}
	},
	{
		'-',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,1,1,1,1,1,1,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'.',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0}
		}
	},
	{
		'/',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,1},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'0',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'1',	
		{
			{0,0,0,0,1,0,0,0},
			{0,0,1,1,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,1,1,1,1,1,0}
		}
	},
	{
		'2',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,1,1,1,1,0}
		}
	},
	{
		'3',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,1,1,0,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'4',
		{
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,1,0,0},
			{0,0,0,0,1,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,1,1,1,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,1,1,0}
		}
	},
	{
		'5',
		{
			{0,0,1,1,1,1,1,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,1,1,1,0,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'6',
		{
			{0,0,0,0,1,1,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'7',
		{
			{0,0,1,1,1,1,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0}
		}
	},
	{
		'8',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'9',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,1,1,0,0,0}
		}
	},
	{
		':',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		';',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'<',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'=',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,1,1,1,1,1,0},
			{0,0,0,0,0,0,0,0},
			{0,0,1,1,1,1,1,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'>',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,0,0,0,0}

		}
	},
	{
		'?',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,1,0,0,0}
		}
	},
	{
		'@',
		{
			{0,0,0,1,1,1,1,0},
			{0,0,1,0,0,0,0,1},
			{0,1,0,0,1,1,0,1},
			{0,1,0,1,0,1,0,1},
			{0,1,0,1,0,1,0,1},
			{0,1,0,1,0,1,0,1},
			{0,1,0,0,1,1,1,0},
			{0,0,1,0,0,0,0,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'A',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,1,1,1,1,0},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,0,1,1,1}
		}
	},
	{
		'B',
		{
			{0,1,1,1,1,1,1,0},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,1,1,1,1,0},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,1,1,1,1,1,1,0}
		}
	},
	{
		'C',
		{
			{0,0,0,1,1,1,1,0},
			{0,0,1,0,0,0,0,1},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,0,1,0,0,0,0,1},
			{0,0,0,1,1,1,1,0}
		}
	},
	{
		'D',
		{
			{0,1,1,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,1,1,0,0}
		}
	},
	{
		'E',
		{
			{0,1,1,1,1,1,1,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,1,1,1,0,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,1},
			{0,1,1,1,1,1,1,1}
		}
	},
	{
		'F',
		{
			{0,1,1,1,1,1,1,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,1,1,1,0,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,1,1,1,1,0,0,0}
		}
	},
	{
		'G',
		{
			{0,0,0,1,1,1,1,0},
			{0,0,1,0,0,0,0,1},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,1,1,1},
			{0,1,0,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,0,1,1,1,1,0}
		}
	},
	{
		'H',
		{
			{0,1,1,1,0,1,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,1,1,1,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,0,1,1,1}
		}
	},
	{
		'I',
		{
			{0,0,1,1,1,1,1,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,1,1,1,1,1,0}
		}
	},
	{
		'J',
		{
			{0,0,0,1,1,1,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,1,0,0,0,1,0,0},
			{0,1,0,0,0,1,0,0},
			{0,0,1,1,1,0,0,0}
		}
	},
	{
		'K',
		{
			{0,1,1,1,0,0,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,0,1,0,0,0},
			{0,0,1,0,1,0,0,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,0,0,1,1}
		}
	},
	{
		'L',
		{
			{0,1,1,1,1,1,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,1},
			{0,1,1,1,1,1,1,1}
		}
	},
	{
		'M',
		{
			{0,1,1,0,0,0,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,1,0,1,1,0},
			{0,0,1,1,0,1,1,0},
			{0,0,1,0,1,0,1,0},
			{0,0,1,0,1,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,0,1,1,1}
		}
	},
	{
		'N',
		{
			{0,1,1,0,0,1,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,1,0,0,1,0},
			{0,0,1,1,0,0,1,0},
			{0,0,1,0,1,0,1,0},
			{0,0,1,0,0,1,1,0},
			{0,0,1,0,0,1,1,0},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,0,0,1,0}
		}
	},
	{
		'O',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'P',
		{
			{0,1,1,1,1,1,1,0},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,1,1,1,1,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,1,1,1,1,0,0,0}
		}
	},
	{
		'Q',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0},
			{0,0,0,1,0,0,1,1}
		}
	},
	{
		'R',
		{
			{0,1,1,1,1,1,1,0},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,0,0,0,0,1},
			{0,0,1,1,1,1,1,0},
			{0,0,1,0,0,1,0,0},
			{0,0,1,0,0,1,1,0},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,0,0,1,1}
		}
	},
	{
		'S',
		{
			{0,0,1,1,1,1,1,0},
			{0,1,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,0,1,1,1,1,1,0},
			{0,0,0,0,0,0,0,1},
			{0,0,0,0,0,0,0,1},
			{0,1,0,0,0,0,0,1},
			{0,0,1,1,1,1,1,0}
		}
	},
	{
		'T',
		{
			{0,1,1,1,1,1,1,1},
			{0,1,0,0,1,0,0,1},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'U',
		{
			{0,1,1,1,0,1,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'V',
		{
			{0,1,1,1,0,1,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0}
		}
	},
	{
		'W',
		{
			{0,1,1,1,0,1,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,1,0,1,0},
			{0,0,1,0,1,0,1,0},
			{0,0,1,0,1,0,1,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0}
		}
	},
	{
		'X',
		{
			{0,1,1,1,0,1,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,1,1,1,0,1,1,1}
		}
	},
	{
		'Y',
		{
			{0,1,1,1,0,1,1,1},
			{0,0,1,0,0,0,1,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'Z',
		{
			{0,1,1,1,1,1,1,1},
			{0,1,0,0,0,0,1,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,1,0,0,0,0,1},
			{0,1,1,1,1,1,1,1}
		}
	},
	{
		'[',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'\\',
		{
			{0,0,0,0,0,0,0,0},
			{0,1,0,0,0,0,0,0},
			{0,0,1,0,0,0,0,0},
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,0,1,0},
			{0,0,0,0,0,0,0,1},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		']',
		{
			{0,0,0,1,1,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,0,0,1,0,0},
			{0,0,0,1,1,1,0,0}
		}
	},
	{
		'^',
		{
			{0,0,0,0,1,0,0,0},
			{0,0,0,1,0,1,0,0},
			{0,0,1,0,0,0,1,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'_',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,1,1,1,1,1,1,0}
		}
	},
	{
		'`',
		{
			{0,0,0,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	},
	{
		'{',
		{
			{0,0,0,0,0,1,1,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,1,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,1,1,0}
		}
	},
	{
		'|',
		{
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0}
		}
	},
	{
		'}',
		{
			{0,0,1,1,0,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,0,1,1,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,0,0,1,0,0,0},
			{0,0,1,1,0,0,0,0}
		}
	},
	{
		'~',
		{
			{0,0,0,0,0,0,0,0},
			{0,0,1,1,0,0,0,1},
			{0,1,0,0,1,0,0,1},
			{0,1,0,0,0,1,1,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0}
		}
	}
};

int draw_text (unsigned char *frame, int startx, int starty, const char *text)
{
	int i,pos=0,x,y;

	if(startx>width/2){
		startx-=(int)strlen(text)*8;
		if(startx<0)
			startx=0;
	}
	while(text[pos]){
		if(startx+(pos+1)*8>=width)
			break;
		i=0;
		while(font_table[i].ascii && font_table[i].ascii!=toupper(text[pos])) i++;
		for(x=0; x<8; x++){
			for(y=0; y<9;y++){
				if(font_table[i].font[y][x]){
					frame[(x+startx+pos*8)*3+0+(y+starty+1)*width*3]=0;
					frame[(x+startx+pos*8)*3+1+(y+starty+1)*width*3]=0;
					frame[(x+startx+pos*8)*3+2+(y+starty+1)*width*3]=0;
					frame[(x+startx+pos*8)*3+0+(y+starty-1)*width*3]=0;
					frame[(x+startx+pos*8)*3+1+(y+starty-1)*width*3]=0;
					frame[(x+startx+pos*8)*3+2+(y+starty-1)*width*3]=0;
					frame[(x+startx+pos*8-1)*3+0+(y+starty)*width*3]=0;
					frame[(x+startx+pos*8-1)*3+1+(y+starty)*width*3]=0;
					frame[(x+startx+pos*8-1)*3+2+(y+starty)*width*3]=0;
					frame[(x+startx+pos*8+1)*3+0+(y+starty)*width*3]=0;
					frame[(x+startx+pos*8+1)*3+1+(y+starty)*width*3]=0;
					frame[(x+startx+pos*8+1)*3+2+(y+starty)*width*3]=0;
					frame[(x+startx+pos*8)*3+0+(y+starty)*width*3]=255;
					frame[(x+startx+pos*8)*3+1+(y+starty)*width*3]=255;
				}
			}
		}
		for(x=0;x<8;x++){
			for(y=0;y<9;y++){
				if(font_table[i].font[y][x]){
					frame[(x+startx+pos*8)*3+0+(y+starty)*width*3]=255;
					frame[(x+startx+pos*8)*3+1+(y+starty)*width*3]=255;
					frame[(x+startx+pos*8)*3+2+(y+starty)*width*3]=255;
				}
			}
		}
		pos++;
	}
	return 0;
}

